package com.example.learnjetpackcompose.frame

import androidx.compose.foundation.layout.Column
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable

/*
 *Author: chinadragon
 *Time: 2024/2/22 22:06
 *
 *  可组合项的生命周期
 *  https://developer.android.google.cn/jetpack/compose/lifecycle?hl=zh-cn
 *
 */

@Composable
fun MyComposable() {
    Column {
        Text("Hello")
        Text("World")
    }
}

@Composable
fun LoginScreen(showError: Boolean) {
    if (showError) {
        LoginError()
    }
    LoginInput() // This call site affects where LoginInput is placed in Composition
}

@Composable
fun LoginInput() { /* ... */ }

@Composable
fun LoginError() { /* ... */ }